package org.jeecg.modules.demo3.fly.utils;

import org.jeecg.modules.demo3.fly.entity.tcp.DistributionDataBean;

/**
 * 解析飞控数据
 *  byte数组解析具体数值
 * @param
 * @return
 */



public class ParsingData {

    DistributionDataBean distributionDataBean = new DistributionDataBean();

    public DistributionDataBean dataDistribution(byte[] bytesdata) {
        //System.out.println("zkx,bytesdata[0]===========" + bytesdata[0]);
        if (bytesdata[0] == (byte) 0x01) {
            float imu_roll_float = Base_Conversion.byte2float(bytesdata, 1);
            float imu_roll = (float) (180 / Math.PI * imu_roll_float);
            distributionDataBean.setIMU_ROLL(imu_roll);


            float imu_pitch_float = Base_Conversion.byte2float(bytesdata, 5);
            float imu_pitch = (float) (180 / Math.PI * imu_pitch_float);

            distributionDataBean.setIMU_PITCH(imu_pitch);


            //  byte[] imu_yaw_byte = Base_Conversion.subBytes(bytesdata, 9, 4);
            float imu_yaw_float = Base_Conversion.byte2float(bytesdata, 9);
            float imu_yaw = (float) (180 / Math.PI * imu_yaw_float);
            distributionDataBean.setIMU_YAW(imu_yaw);


            byte[] solution_status_byte = Base_Conversion.subBytes(bytesdata, 13, 4);
            int solution_status_int = Base_Conversion.byte2int(solution_status_byte);
            byte solution_Temp=(byte)(solution_status_int&0xF);
           String solution_str = "";
            switch (solution_Temp) {
                case 0:
                 //  zhgd_gdrhzt_edit.setText("初始化");
                    solution_str = "初始化";
                    break;
                case 1:
                  //  zhgd_gdrhzt_edit.setText("垂直陀螺模式");
                    solution_str = "垂直陀螺模式";
                    break;
                case 2:
                  // zhgd_gdrhzt_edit.setText("姿态导航模式");
                    solution_str = "姿态导航模式";
                    break;
                case 3:
                   // zhgd_gdrhzt_edit.setText("速度导航模式");
                    solution_str = "速度导航模式";
                    break;
                case 4:
                   // zhgd_gdrhzt_edit.setText("完全导航模式");
                    solution_str = "完全导航模式";
                    break;
            }

            distributionDataBean.setSOLUTION_STATUS(solution_str);
            distributionDataBean.setSOLUTION_STATUS_Number(solution_Temp);

            //  byte[] ekf_vel_n_byte = Base_Conversion.subBytes(bytesdata, 17, 4);
            float ekf_vel_n_float = Base_Conversion.byte2float(bytesdata, 17);
            // sin(IMU_YAW) *EKF_VEL_E - cos(IMU_YAW) *EKF_VEL_N  imu_yaw_float


            //   byte[] ekf_vel_e_byte = Base_Conversion.subBytes(bytesdata, 21, 4);
            float ekf_vel_e_float = Base_Conversion.byte2float(bytesdata, 21);
            // cos(IMU_YAW)*EKF_VEL_E - sin(IMU_YAW) *EKF_VEL_N

            float ekf_vel_e = (float) (Math.cos(imu_yaw_float) * ekf_vel_e_float - Math.sin(imu_yaw_float) * ekf_vel_n_float);
            float ekf_vel_n = (float) (Math.sin(imu_yaw_float) * ekf_vel_e_float + Math.cos(imu_yaw_float) * ekf_vel_n_float);
            // Vx= sin(IMU_YAW) *EKF_VEL_E - cos(IMU_YAW) *EKF_VEL_N


            distributionDataBean.setEKF_VEL_E(ekf_vel_e);//侧向速度
            distributionDataBean.setEKF_VEL_N(ekf_vel_n);//前向速度

            //  byte[] ekf_vel_d_byte = Base_Conversion.subBytes(bytesdata, 25, 4);
            float ekf_vel_d_float = Base_Conversion.byte2float(bytesdata, 25);
            distributionDataBean.setEKF_VEL_D(ekf_vel_d_float);


            byte[] ekf_lat_byte = Base_Conversion.subBytes(bytesdata, 29, 8);
            double ekf_lat_double = Base_Conversion.bytes2Double(ekf_lat_byte);
            distributionDataBean.setEKF_LAT(ekf_lat_double);


            byte[] ekf_lon_byte = Base_Conversion.subBytes(bytesdata, 37, 8);
            double ekf_lon_double = Base_Conversion.bytes2Double(ekf_lon_byte);
            distributionDataBean.setEKF_LON(ekf_lon_double);


            byte[] ekf_alt_byte = Base_Conversion.subBytes(bytesdata, 45, 8);
            double ekf_alt_double = Base_Conversion.bytes2Double(ekf_alt_byte);
            distributionDataBean.setEKF_ALT(ekf_alt_double);


            byte[] gps_pos_status_byte = Base_Conversion.subBytes(bytesdata, 53, 4);
            int gps_pos_status_int = Base_Conversion.byte2int(gps_pos_status_byte);
            byte gps_pos_temp=(byte)((gps_pos_status_int>>6)&0xF);
            String gps_pos_str = "";
            switch (gps_pos_temp) {
                case 0:
                   // zhgd_gpsdwlx_edit.setText("初始化");
                    gps_pos_str ="初始化";
                    break;
                case 1:
                   // zhgd_gpsdwlx_edit.setText("未知类型");
                    gps_pos_str ="未知类型";
                    break;
                case 2:
                   // zhgd_gpsdwlx_edit.setText("单点定位");
                    gps_pos_str ="单点定位";
                    break;
                case 3:
                  //  zhgd_gpsdwlx_edit.setText("伪距定位");
                    gps_pos_str ="伪距定位";
                    break;
                case 4:
                   // zhgd_gpsdwlx_edit.setText("SBAS");
                    gps_pos_str ="SBAS";
                    break;
                case 5:
                  //  zhgd_gpsdwlx_edit.setText("OMNSTAR");
                    gps_pos_str ="OMNSTAR";
                    break;
                case 6:
                 //   zhgd_gpsdwlx_edit.setText("低精度");
                    gps_pos_str ="低精度";
                    break;
                case 7:
                   // zhgd_gpsdwlx_edit.setText("高精度");
                    gps_pos_str ="高精度";
                    break;
                case 8:
                   // zhgd_gpsdwlx_edit.setText("PPPF");
                    gps_pos_str ="PPPF";
                    break;
                case 9:
                   // zhgd_gpsdwlx_edit.setText("PPPI");
                    gps_pos_str ="PPPI";
                    break;
                case 10:
                   // zhgd_gpsdwlx_edit.setText("FIXED");
                    gps_pos_str ="FIXED";
                    break;
            }
            distributionDataBean.setGPS_POS_STATUS(gps_pos_str);
            distributionDataBean.setGPS_POS_STATUS_Number(gps_pos_temp);

            byte[] num_sv_used_byte = Base_Conversion.subBytes(bytesdata, 57, 1);
            distributionDataBean.setNUM_SV_USED(num_sv_used_byte[0]);


            byte[] futaba_ctrl_byte = Base_Conversion.subBytes(bytesdata, 58, 2);
            short futaba_ctrl_short = Base_Conversion.byte2shortLittleEndian(futaba_ctrl_byte);
            String futaba_ctrl_str = "";
            if (futaba_ctrl_short >= 1300) {
               // oper_face_flight_mode_value.setText("自主模式");//飞行模式
                futaba_ctrl_str = "自主模式";
            } else if (1299 >= futaba_ctrl_short && futaba_ctrl_short >= 700) {
               // oper_face_flight_mode_value.setText("増稳模式");//飞行模式
                futaba_ctrl_str = "増稳模式";
            } else {
               // oper_face_flight_mode_value.setText("手动模式");//飞行模式
                futaba_ctrl_str = "手动模式";
            }


            distributionDataBean.setFutaba_ctrl(futaba_ctrl_str);


            byte[] engspeed_byte = Base_Conversion.subBytes(bytesdata, 60, 2);
            short engspeed_short = Base_Conversion.byte2shortLittleEndian(engspeed_byte);
            distributionDataBean.setEngSpeed(engspeed_short);


            byte[] col_ctrl_byte = Base_Conversion.subBytes(bytesdata, 62, 2);
            short col_ctrl_short = Base_Conversion.byte2shortLittleEndian(col_ctrl_byte);
            col_ctrl_short = (short) (((1696 - (float)col_ctrl_short) / 1344) * 100);
            distributionDataBean.setCol_Ctrl(col_ctrl_short);


            byte[] thu_out_byte = Base_Conversion.subBytes(bytesdata, 64, 2);
            short thu_out_short = Base_Conversion.byte2shortLittleEndian(thu_out_byte);

            // thu_out_short = (short) (((1696 - col_ctrl_short) / 1344) * 100);

            //Boolean ymkzfx_check = Hawk.get("ymkzfx_check");
            //System.out.println("youmen,ymkzfx_check======="+ymkzfx_check);
            int thu_out_int;
            if (true) {
                thu_out_int = (int)((((float)thu_out_short - 352) / 1344) * 100);
            } else {
                thu_out_int = (int)(((1696 - (float)thu_out_short) / 1344) * 100);
            }
            distributionDataBean.setThu_Out((short) thu_out_int);
            byte[] flystep_byte = Base_Conversion.subBytes(bytesdata, 66, 1);
            distributionDataBean.setFlyStep(flystep_byte[0]);
            byte[] flystatus1_byte = Base_Conversion.subBytes(bytesdata, 67, 1);
            distributionDataBean.setFlyStatus1(flystatus1_byte[0]);
            byte[] flystatus2_byte = Base_Conversion.subBytes(bytesdata, 68, 1);
            distributionDataBean.setFlyStatus2(flystatus2_byte[0]);
            byte[] rel_heigh_byte = Base_Conversion.subBytes(bytesdata, 69, 2);
            short rel_heigh_short = Base_Conversion.byte2shortLittleEndian(rel_heigh_byte);
            rel_heigh_short = (short) (rel_heigh_short / 10);
            distributionDataBean.setRel_Heigh(rel_heigh_short);
            byte[] hl_heigh_byte = Base_Conversion.subBytes(bytesdata, 71, 2);
            short hl_heigh_short = Base_Conversion.byte2shortLittleEndian(hl_heigh_byte);
            distributionDataBean.setHL_Heigh(hl_heigh_short);
            byte[] hl_vaild_byte = Base_Conversion.subBytes(bytesdata, 73, 1);
            distributionDataBean.setHeigh_Vaild(hl_vaild_byte[0]);
            // byte[] x_dis_byte = Base_Conversion.subBytes(bytesdata, 74, 4);
            float x_dis_float = Base_Conversion.byte2float(bytesdata, 74);
            distributionDataBean.setX_Dis(x_dis_float);

            //byte[] y_dis_byte = Base_Conversion.subBytes(bytesdata, 78, 4);
            float y_dis_float = Base_Conversion.byte2float(bytesdata, 78);
            distributionDataBean.setY_Dis(y_dis_float);

            byte[] flow_pv_byte = Base_Conversion.subBytes(bytesdata, 82, 2);
            short flow_pv_short = Base_Conversion.byte2shortLittleEndian(flow_pv_byte);
            distributionDataBean.setFlow_pv(flow_pv_short);

            byte[] gyr_msg_byte = Base_Conversion.subBytes(bytesdata, 84, 12);
            short gyr_msg_short = Base_Conversion.byte2shortLittleEndian(gyr_msg_byte);
            distributionDataBean.setGyr_Msg(gyr_msg_short);

            byte[] Serial_number_byte = Base_Conversion.subBytes(bytesdata, 96, 4);
            int Serial_numbe_int = Base_Conversion.byte2intLittleEndian(Serial_number_byte);
            distributionDataBean.setSerial_number(Serial_numbe_int);  //序列号 标识符
        } else if (bytesdata[0] == (byte) 0x10) {

            byte[] version1 = Base_Conversion.subBytes(bytesdata, 1, 4);
            String ver1 = version1[0] + "." + version1[1] + "." + version1[2] + "." + version1[3];
            distributionDataBean.setVersion1(ver1);

            byte[] version2 = Base_Conversion.subBytes(bytesdata, 5, 4);
            String ver2 = version2[0] + "." + version2[1] + "." + version2[2] + "." + version2[3];
            distributionDataBean.setVersion2(ver2);


            //  byte[] imu_temp_byte = Base_Conversion.subBytes(bytesdata, 9, 4);
            float imu_temp_float = Base_Conversion.byte2float(bytesdata, 9);
            distributionDataBean.setIMU_TEMP(imu_temp_float);

            byte[] data1_byte = Base_Conversion.subBytes(bytesdata, 13, 2);
            short data1_short = Base_Conversion.byte2shortLittleEndian(data1_byte);
            // double water_tem = 5 / ((data1_short / 4096) * 3.3) - 5.99;               //水温
            distributionDataBean.setWater_tem(data1_short);

            byte[] data2_byte = Base_Conversion.subBytes(bytesdata, 15, 2);
            short data2_short = Base_Conversion.byte2shortLittleEndian(data2_byte);
            //  double left_cylinder_tem = 5 / ((data2_short / 4096) * 3.3) - 5.99;            //左缸温
            distributionDataBean.setLeft_cylinder_tem(data2_short);

            byte[] data3_byte = Base_Conversion.subBytes(bytesdata, 17, 2);
            short data3_short = Base_Conversion.byte2shortLittleEndian(data3_byte);
            //  double right_cylinder_tem = 5 / ((data3_short / 4096) * 3.3) - 5.99;        //   右缸温
            distributionDataBean.setRight_cylinder_tem(data3_short);

            byte[] data4_byte = Base_Conversion.subBytes(bytesdata, 19, 2);
            short data4_short = Base_Conversion.byte2shortLittleEndian(data4_byte);
            distributionDataBean.setData4(data4_short);


            byte[] fk_vol_byte = Base_Conversion.subBytes(bytesdata, 21, 2);   //系统电压  sys volt
            short fk_vol_short = Base_Conversion.byte2shortLittleEndian(fk_vol_byte);
            System.out.println("xtdy,fk_vol_short=系统电压=======" + fk_vol_short);
            // double system_voltage = (fk_vol_short / 4096.0) * 19.8;
            distributionDataBean.setSys_vol(fk_vol_short);


            byte[] sv_vol_byte = Base_Conversion.subBytes(bytesdata, 23, 2);        //舵机电压  server volt
            short sv_vol_short = Base_Conversion.byte2shortLittleEndian(sv_vol_byte);
            // double server_volt = (sv_vol_short / 4096) * 19.8;
            distributionDataBean.setServer_vol(sv_vol_short);


            byte[] airline_data_len_byte = Base_Conversion.subBytes(bytesdata, 25, 2);
            short airline_data_len_short = Base_Conversion.byte2shortLittleEndian(airline_data_len_byte);
            distributionDataBean.setAirline_data_len(airline_data_len_short);

            byte[] fktemp_byte = Base_Conversion.subBytes(bytesdata, 27, 2);
            short fktemp_byte_short = Base_Conversion.byte2shortLittleEndian(fktemp_byte);
            float fk = (float) (fktemp_byte_short * 0.25);
            distributionDataBean.setFKTemp(fk);

            byte[] flystatus1_byte = Base_Conversion.subBytes(bytesdata, 29, 1);
            distributionDataBean.setFlyStatus1(flystatus1_byte[0]);

            byte[] flystatus2_byte = Base_Conversion.subBytes(bytesdata, 30, 1);
            distributionDataBean.setFlyStatus2(flystatus2_byte[0]);

            byte[] present_line_byte = Base_Conversion.subBytes(bytesdata, 31, 1);
            distributionDataBean.setPresent_Line(present_line_byte[0]);

            //byte[] yawmb_byte = Base_Conversion.subBytes(bytesdata, 32, 4);
            float yawmb_float = Base_Conversion.byte2float(bytesdata, 32);
            distributionDataBean.setYawMB(yawmb_float);

            // byte[] altmb_byte = Base_Conversion.subBytes(bytesdata, 36, 4);
            float altmb_float = Base_Conversion.byte2float(bytesdata, 36);
            distributionDataBean.setALTMB(altmb_float);


            byte[] home_lat_byte = Base_Conversion.subBytes(bytesdata, 40, 8);
            double home_lat_double = Base_Conversion.bytes2Double(home_lat_byte);
            distributionDataBean.setHome_Lat(home_lat_double);


            byte[] home_lon_byte = Base_Conversion.subBytes(bytesdata, 48, 8);
            double home_lon_double = Base_Conversion.bytes2Double(home_lon_byte);
            distributionDataBean.setHome_Lon(home_lon_double);


            byte[] breaklat_byte = Base_Conversion.subBytes(bytesdata, 56, 8);
            double breaklat_double = Base_Conversion.bytes2Double(breaklat_byte);
            distributionDataBean.setBreakLat(breaklat_double);


            byte[] breaklon_byte = Base_Conversion.subBytes(bytesdata, 64, 8);
            double breaklon_double = Base_Conversion.bytes2Double(breaklon_byte);
            distributionDataBean.setBreakLon(breaklon_double);

            // byte[] eng_total_byte = Base_Conversion.subBytes(bytesdata, 72, 4);
            float eng_total_float = Base_Conversion.byte2float(bytesdata, 72);
            distributionDataBean.setEng_Total(eng_total_float);


            //  byte[] area_total_byte = Base_Conversion.subBytes(bytesdata, 76, 4);
            float area_total_float = Base_Conversion.byte2float(bytesdata, 76);
            distributionDataBean.setArea_Total(area_total_float);


            //  byte[] area_total2_byte = Base_Conversion.subBytes(bytesdata, 80, 4);
            float area_total2_float = Base_Conversion.byte2float(bytesdata, 80);
            distributionDataBean.setArea_Total2(area_total2_float);

            //   byte[] flow_total2_byte = Base_Conversion.subBytes(bytesdata, 84, 4);
            float flow_total2_float = Base_Conversion.byte2float(bytesdata, 84);
            distributionDataBean.setFlow_Total2(flow_total2_float);

            //   byte[] flow_size_byte = Base_Conversion.subBytes(bytesdata, 88, 4);
            float flow_size_float = Base_Conversion.byte2float(bytesdata, 88);
            distributionDataBean.setFlow_Size(flow_size_float);

            // byte[] area_size_byte = Base_Conversion.subBytes(bytesdata, 92, 4);
            float area_size_float = Base_Conversion.byte2float(bytesdata, 92);
            distributionDataBean.setArea_Size(area_size_float);

        } else if (bytesdata[0] == (byte) 0x20) {


            byte[] version1 = Base_Conversion.subBytes(bytesdata, 1, 4);
            String ver1 = version1[0] + "." + version1[1] + "." + version1[2] + "." + version1[3];
            distributionDataBean.setVersion1(ver1);

            byte[] version2 = Base_Conversion.subBytes(bytesdata, 5, 4);
            String ver2 = version2[0] + "." + version2[1] + "." + version2[2] + "." + version2[3];
            distributionDataBean.setVersion2(ver2);

            //  byte[] imu_temp_byte = Base_Conversion.subBytes(bytesdata, 9, 4);
            float imu_temp_float = Base_Conversion.byte2float(bytesdata, 9);
            distributionDataBean.setIMU_TEMP(imu_temp_float);


            byte[] fktemp_byte = Base_Conversion.subBytes(bytesdata, 13, 2);
            short fktemp_byte_short = Base_Conversion.byte2shortLittleEndian(fktemp_byte);
            // FKTemp*0.25
            float fk = (float) (fktemp_byte_short * 0.25);
            distributionDataBean.setFKTemp(fk);


            byte[] data1_byte = Base_Conversion.subBytes(bytesdata, 15, 2);
            short data1_short = Base_Conversion.byte2shortLittleEndian(data1_byte);
            double water_tem = 5 / ((data1_short / 4096) * 3.3) - 5.99;               //水温
            distributionDataBean.setWater_tem(data1_short);

            byte[] data2_byte = Base_Conversion.subBytes(bytesdata, 17, 2);
            short data2_short = Base_Conversion.byte2shortLittleEndian(data2_byte);
            // double left_cylinder_tem = 5 / ((data2_short / 4096) * 3.3) - 5.99;            //左缸温
            distributionDataBean.setLeft_cylinder_tem(data2_short);

            byte[] data3_byte = Base_Conversion.subBytes(bytesdata, 19, 2);
            short data3_short = Base_Conversion.byte2shortLittleEndian(data3_byte);
            // double right_cylinder_tem = 5 / ((data3_short / 4096) * 3.3) - 5.99;   //右缸温
            distributionDataBean.setRight_cylinder_tem(data3_short);

            byte[] data4_byte = Base_Conversion.subBytes(bytesdata, 21, 2);
            short data4_short = Base_Conversion.byte2shortLittleEndian(data4_byte);
            distributionDataBean.setData4(data4_short);


            byte[] data5_byte = Base_Conversion.subBytes(bytesdata, 23, 2);
            short data5_short = Base_Conversion.byte2shortLittleEndian(data5_byte);
            distributionDataBean.setData5(data5_short);

            byte[] data6_byte = Base_Conversion.subBytes(bytesdata, 25, 2);
            short data6_short = Base_Conversion.byte2shortLittleEndian(data6_byte);
            //  float Steering_gear_voltage = (float) ((data6_short / 4096) * 19.8);
            distributionDataBean.setData6(data6_short);


            byte[] fk_vol_byte = Base_Conversion.subBytes(bytesdata, 27, 2);   //系统电压  sys volt
            short fk_vol_short = Base_Conversion.byte2shortLittleEndian(fk_vol_byte);
            // double system_voltage = (fk_vol_short / 4096) * 19.8;
            distributionDataBean.setSys_vol(fk_vol_short);


            byte[] sv_vol_byte = Base_Conversion.subBytes(bytesdata, 29, 2);        //舵机电压  server volt
            short sv_vol_short = Base_Conversion.byte2shortLittleEndian(sv_vol_byte);
            //  double server_volt = (sv_vol_short / 4096) * 19.8;
            distributionDataBean.setServer_vol(sv_vol_short);

            byte[] airline_data_len_byte = Base_Conversion.subBytes(bytesdata, 31, 2);
            short airline_data_len_short = Base_Conversion.byte2shortLittleEndian(airline_data_len_byte);
            distributionDataBean.setAirline_data_len(airline_data_len_short);


            byte[] flystatus1_byte = Base_Conversion.subBytes(bytesdata, 33, 1);
            distributionDataBean.setFlyStatus1(flystatus1_byte[0]);

            byte[] flystatus2_byte = Base_Conversion.subBytes(bytesdata, 34, 1);
            distributionDataBean.setFlyStatus2(flystatus2_byte[0]);

            byte[] present_line_byte = Base_Conversion.subBytes(bytesdata, 35, 1);
            distributionDataBean.setPresent_Line(present_line_byte[0]);

            // byte[] yawmb_byte = Base_Conversion.subBytes(bytesdata, 36, 4);
            float yawmb_float = Base_Conversion.byte2float(bytesdata, 36);
            distributionDataBean.setYawMB(yawmb_float);

            //  byte[] altmb_byte = Base_Conversion.subBytes(bytesdata, 40, 4);
            float altmb_float = Base_Conversion.byte2float(bytesdata, 40);
            distributionDataBean.setALTMB(altmb_float);


            byte[] home_lat_byte = Base_Conversion.subBytes(bytesdata, 44, 8);
            double home_lat_double = Base_Conversion.bytes2Double(home_lat_byte);
            distributionDataBean.setHome_Lat(home_lat_double);


            byte[] home_lon_byte = Base_Conversion.subBytes(bytesdata, 52, 8);
            double home_lon_double = Base_Conversion.bytes2Double(home_lon_byte);
            distributionDataBean.setHome_Lon(home_lon_double);


            byte[] breaklat_byte = Base_Conversion.subBytes(bytesdata, 60, 8);
            double breaklat_double = Base_Conversion.bytes2Double(breaklat_byte);
            distributionDataBean.setBreakLat(breaklat_double);


            byte[] breaklon_byte = Base_Conversion.subBytes(bytesdata, 68, 8);
            double breaklon_double = Base_Conversion.bytes2Double(breaklon_byte);
            distributionDataBean.setBreakLon(breaklon_double);

            //byte[] eng_total_byte = Base_Conversion.subBytes(bytesdata, 76, 4);
            float eng_total_float = Base_Conversion.byte2float(bytesdata, 76);
            distributionDataBean.setEng_Total(eng_total_float);


            // byte[] area_total_byte = Base_Conversion.subBytes(bytesdata, 80, 4);
            float area_total_float = Base_Conversion.byte2float(bytesdata, 80);
            distributionDataBean.setArea_Total(area_total_float);


            //  byte[] area_total2_byte = Base_Conversion.subBytes(bytesdata, 84, 4);
            float area_total2_float = Base_Conversion.byte2float(bytesdata, 84);
            distributionDataBean.setArea_Total2(area_total2_float);

            //byte[] flow_total2_byte = Base_Conversion.subBytes(bytesdata, 88, 4);
            float flow_total2_float = Base_Conversion.byte2float(bytesdata, 88);
            distributionDataBean.setFlow_Total2(flow_total2_float);

            // byte[] flow_size_byte = Base_Conversion.subBytes(bytesdata, 92, 4);
            float flow_size_float = Base_Conversion.byte2float(bytesdata, 92);
            distributionDataBean.setFlow_Size(flow_size_float);

            // byte[] area_size_byte = Base_Conversion.subBytes(bytesdata, 96, 4);
            float area_size_float = Base_Conversion.byte2float(bytesdata, 96);
            distributionDataBean.setArea_Size(area_size_float);

        } else if (bytesdata[0] == (byte) 0x40) {


            byte[] version1 = Base_Conversion.subBytes(bytesdata, 1, 4);
            String ver1 = version1[0] + "." + version1[1] + "." + version1[2] + "." + version1[3];
            distributionDataBean.setVersion1(ver1);

            byte[] version2 = Base_Conversion.subBytes(bytesdata, 5, 4);
            String ver2 = version2[0] + "." + version2[1] + "." + version2[2] + "." + version2[3];
            distributionDataBean.setVersion2(ver2);


            //byte[] imu_temp_byte = Base_Conversion.subBytes(bytesdata, 9, 4);
            float imu_temp_float = Base_Conversion.byte2float(bytesdata, 9);
            distributionDataBean.setIMU_TEMP(imu_temp_float);


            byte[] fktemp_byte = Base_Conversion.subBytes(bytesdata, 13, 2);
            short fktemp_byte_short = Base_Conversion.byte2shortLittleEndian(fktemp_byte);
            // FKTemp*0.25
            float fk = (float) (fktemp_byte_short * 0.25);
            distributionDataBean.setFKTemp(fk);

            byte[] fk_vol_byte = Base_Conversion.subBytes(bytesdata, 15, 2);   //系统电压  sys volt
            short fk_vol_short = Base_Conversion.byte2shortLittleEndian(fk_vol_byte);
            //  double system_voltage1 = (fk_vol_short / 4096) * 19.8;
            distributionDataBean.setSys_vol(fk_vol_short);

            byte[] data2_byte = Base_Conversion.subBytes(bytesdata, 17, 2);
            short data2_short = Base_Conversion.byte2shortLittleEndian(data2_byte);
            distributionDataBean.setData2(data2_short);


            byte[] data3_byte = Base_Conversion.subBytes(bytesdata, 19, 2);
            short data3_short = Base_Conversion.byte2shortLittleEndian(data3_byte);
            distributionDataBean.setData3(data3_short);

            byte[] data4_byte = Base_Conversion.subBytes(bytesdata, 21, 2);
            short data4_short = Base_Conversion.byte2shortLittleEndian(data4_byte);
            //double water_tem = 5 / ((data4_short / 4096) * 3.3) - 5.99;               //水温
            distributionDataBean.setWater_tem(data4_short);


            byte[] data5_byte = Base_Conversion.subBytes(bytesdata, 23, 2);
            short data5_short = Base_Conversion.byte2shortLittleEndian(data5_byte);
            distributionDataBean.setData5(data5_short);

            byte[] data6_byte = Base_Conversion.subBytes(bytesdata, 25, 2);
            short data6_short = Base_Conversion.byte2shortLittleEndian(data6_byte);
            // double left_cylinder_tem = 5 / ((data6_short / 4096) * 3.3) - 5.99;            //左缸温
            distributionDataBean.setLeft_cylinder_tem(data6_short);


            byte[] data7_byte = Base_Conversion.subBytes(bytesdata, 27, 2);
            short data7_short = Base_Conversion.byte2shortLittleEndian(data7_byte);
            //  double right_cylinder_tem = 5 / ((data7_short / 4096) * 3.3) - 5.99;   //右缸温
            distributionDataBean.setRight_cylinder_tem(data7_short);

            byte[] data8_byte = Base_Conversion.subBytes(bytesdata, 29, 2);
            short data8_short = Base_Conversion.byte2shortLittleEndian(data8_byte);
            distributionDataBean.setData8(data8_short);


            byte[] airline_data_len_byte = Base_Conversion.subBytes(bytesdata, 31, 2);
            short airline_data_len_short = Base_Conversion.byte2shortLittleEndian(airline_data_len_byte);
            distributionDataBean.setAirline_data_len(airline_data_len_short);


            byte[] flystatus1_byte = Base_Conversion.subBytes(bytesdata, 33, 1);
            distributionDataBean.setFlyStatus1(flystatus1_byte[0]);

            byte[] flystatus2_byte = Base_Conversion.subBytes(bytesdata, 34, 1);
            distributionDataBean.setFlyStatus2(flystatus2_byte[0]);

            byte[] present_line_byte = Base_Conversion.subBytes(bytesdata, 35, 1);
            distributionDataBean.setPresent_Line(present_line_byte[0]);

            // byte[] yawmb_byte = Base_Conversion.subBytes(bytesdata, 36, 4);
            float yawmb_float = Base_Conversion.byte2float(bytesdata, 36);
            distributionDataBean.setYawMB(yawmb_float);

            //  byte[] altmb_byte = Base_Conversion.subBytes(bytesdata, 40, 4);
            float altmb_float = Base_Conversion.byte2float(bytesdata, 40);
            distributionDataBean.setALTMB(altmb_float);


            byte[] home_lat_byte = Base_Conversion.subBytes(bytesdata, 44, 8);
            double home_lat_double = Base_Conversion.bytes2Double(home_lat_byte);
            distributionDataBean.setHome_Lat(home_lat_double);


            byte[] home_lon_byte = Base_Conversion.subBytes(bytesdata, 52, 8);
            double home_lon_double = Base_Conversion.bytes2Double(home_lon_byte);
            distributionDataBean.setHome_Lon(home_lon_double);


            byte[] breaklat_byte = Base_Conversion.subBytes(bytesdata, 60, 8);
            double breaklat_double = Base_Conversion.bytes2Double(breaklat_byte);
            distributionDataBean.setBreakLat(breaklat_double);


            byte[] breaklon_byte = Base_Conversion.subBytes(bytesdata, 68, 8);
            double breaklon_double = Base_Conversion.bytes2Double(breaklon_byte);
            distributionDataBean.setBreakLon(breaklon_double);


            byte[] sv_vol_byte = Base_Conversion.subBytes(bytesdata, 76, 2);        //舵机电压  server volt
            short sv_vol_short = Base_Conversion.byte2shortLittleEndian(sv_vol_byte);
            //double server_volt = (sv_vol_short / 4096) * 19.8;
            distributionDataBean.setServer_vol(sv_vol_short);


            byte[] data10_byte = Base_Conversion.subBytes(bytesdata, 78, 2);
            short data10_short = Base_Conversion.byte2shortLittleEndian(data10_byte);
            distributionDataBean.setData10(data10_short);

            byte[] data11_byte = Base_Conversion.subBytes(bytesdata, 80, 2);
            short data11_short = Base_Conversion.byte2shortLittleEndian(data11_byte);
            distributionDataBean.setData11(data11_short);

            byte[] data12_byte = Base_Conversion.subBytes(bytesdata, 82, 2);
            short data12_short = Base_Conversion.byte2shortLittleEndian(data12_byte);
            distributionDataBean.setData12(data12_short);

            byte[] data13_byte = Base_Conversion.subBytes(bytesdata, 84, 2);
            short data13_short = Base_Conversion.byte2shortLittleEndian(data13_byte);
            distributionDataBean.setData13(data13_short);

            byte[] data14_byte = Base_Conversion.subBytes(bytesdata, 86, 2);
            short data14_short = Base_Conversion.byte2shortLittleEndian(data14_byte);
            distributionDataBean.setData14(data14_short);

            byte[] data15_byte = Base_Conversion.subBytes(bytesdata, 88, 2);
            short data15_short = Base_Conversion.byte2shortLittleEndian(data15_byte);
            distributionDataBean.setData15(data15_short);

            byte[] data16_byte = Base_Conversion.subBytes(bytesdata, 90, 2);
            short data16_short = Base_Conversion.byte2shortLittleEndian(data16_byte);
            distributionDataBean.setData6(data16_short);


            // byte[] eng_total_byte = Base_Conversion.subBytes(bytesdata, 92, 4);
            float eng_total_float = Base_Conversion.byte2float(bytesdata, 92);
            distributionDataBean.setEng_Total(eng_total_float);


            //  byte[] area_total_byte = Base_Conversion.subBytes(bytesdata, 96, 4);
            float area_total_float = Base_Conversion.byte2float(bytesdata, 96);
            distributionDataBean.setArea_Total(area_total_float);


            // byte[] area_total2_byte = Base_Conversion.subBytes(bytesdata, 100, 4);
            float area_total2_float = Base_Conversion.byte2float(bytesdata, 100);
            distributionDataBean.setArea_Total2(area_total2_float);

            //   byte[] flow_total2_byte = Base_Conversion.subBytes(bytesdata, 104, 4);
            float flow_total2_float = Base_Conversion.byte2float(bytesdata, 104);
            distributionDataBean.setFlow_Total2(flow_total2_float);

            // byte[] flow_size_byte = Base_Conversion.subBytes(bytesdata, 108, 4);
            float flow_size_float = Base_Conversion.byte2float(bytesdata, 108);
            distributionDataBean.setFlow_Size(flow_size_float);

            // byte[] area_size_byte = Base_Conversion.subBytes(bytesdata, 112, 4);
            float area_size_float = Base_Conversion.byte2float(bytesdata, 112);
            distributionDataBean.setArea_Size(area_size_float);

        }
        return distributionDataBean;
    }


   /* *//**
     * 解析配置参数数据
     *//*

    public Configuration_parameter_Bean configurationParameter(byte[] bytes) {
        // Log.d("zkx","BuildConfig.Radio_configureParm =  ========"+ Arrays.toString(BuildConfig.Radio_configureParm));
        byte[] roll_bytearray = Base_Conversion.subBytes(bytes, 0, 24);//滚转
        // byte[] roll_Xp_bytes = Base_Conversion.subBytes(roll_bytearray, 0, 4);
        float roll_xp = Base_Conversion.byte2float(roll_bytearray, 0);
        //    byte[] roll_Gyr_Pbytes = Base_Conversion.subBytes(roll_bytearray, 4, 4);
        float roll_Gyr_P = Base_Conversion.byte2float(roll_bytearray, 4);
        // byte[] roll_Gyr_I_bytes = Base_Conversion.subBytes(roll_bytearray, 8, 4);
        float roll_Gyr_I = Base_Conversion.byte2float(roll_bytearray, 8);
        //  byte[] roll_Ctrl_Limit_bytes = Base_Conversion.subBytes(roll_bytearray, 12, 4);
        float roll_Ctrl_Limit = Base_Conversion.byte2float(roll_bytearray, 12);
        //  byte[] roll_Gyr_LH_bytes = Base_Conversion.subBytes(roll_bytearray, 16, 4);
        float roll_Gyr_LH = Base_Conversion.byte2float(roll_bytearray, 16);
        // byte[] roll_I_Corr_bytes = Base_Conversion.subBytes(roll_bytearray, 20, 4);
        float roll_I_Corr = Base_Conversion.byte2float(roll_bytearray, 20);
        // float[] roll_floatarray = Base_Conversion.byteArrayToFloatArray(roll_bytearray);
        Configuration_parameter_Bean.Roll_Bean roll_bean = new Configuration_parameter_Bean.Roll_Bean();
        roll_bean.setXp(roll_xp);
        roll_bean.setGyr_P(roll_Gyr_P);
        roll_bean.setGyr_I(roll_Gyr_I);
        roll_bean.setCtrl_Limit(roll_Ctrl_Limit);
        roll_bean.setGyr_LH(roll_Gyr_LH);
        roll_bean.setI_Corr(roll_I_Corr);
        configurationParameterBean.setRoll_bean(roll_bean);


        byte[] pitch_bytearray = Base_Conversion.subBytes(bytes, 24, 24);//俯仰
        // byte[] pitch_xp_bytes = Base_Conversion.subBytes(pitch_bytearray, 0, 4);
        float pitch_xp = Base_Conversion.byte2float(pitch_bytearray, 0);
        //  byte[] pitch_Gyr_P_bytes = Base_Conversion.subBytes(pitch_bytearray, 4, 4);
        float pitch_Gyr_P = Base_Conversion.byte2float(pitch_bytearray, 4);
        // byte[] pitch_Gyr_I_bytes = Base_Conversion.subBytes(pitch_bytearray, 8, 4);
        float pitch_Gyr_I = Base_Conversion.byte2float(pitch_bytearray, 8);
        // byte[] pitch_Ctrl_Limit_bytes = Base_Conversion.subBytes(pitch_bytearray, 12, 4);
        float pitch_Ctrl_Limit = Base_Conversion.byte2float(pitch_bytearray, 12);
        //     byte[] pitch_Gyr_LH_bytes = Base_Conversion.subBytes(pitch_bytearray, 16, 4);
        float pitch_Gyr_LH = Base_Conversion.byte2float(pitch_bytearray, 16);
        // byte[] pitch_Vx_delta_a_bytes = Base_Conversion.subBytes(pitch_bytearray, 20, 4);
        float pitch_Vx_delta_a = Base_Conversion.byte2float(pitch_bytearray, 20);
        // float[] pitch_floatarray = Base_Conversion.byteArrayToFloatArray(pitch_bytearray);
        Configuration_parameter_Bean.Pitch_Bean pitch_bean = new Configuration_parameter_Bean.Pitch_Bean();
        pitch_bean.setXp(pitch_xp);
        pitch_bean.setGyr_P(pitch_Gyr_P);
        pitch_bean.setGyr_I(pitch_Gyr_I);
        pitch_bean.setCtrl_Limit(pitch_Ctrl_Limit);
        pitch_bean.setGyr_LH(pitch_Gyr_LH);
        pitch_bean.setVx_delta_a(pitch_Vx_delta_a);
        configurationParameterBean.setPitch_bean(pitch_bean);

        byte[] yaw_bytearray = Base_Conversion.subBytes(bytes, 48, 48);//偏航
        //  byte[] yaw_Sv_type_bytes = Base_Conversion.subBytes(yaw_bytearray, 0, 4);
        float yaw_Sv_type = Base_Conversion.byte2float(yaw_bytearray, 0);
        // byte[] yaw_Rud_Int_bytes = Base_Conversion.subBytes(yaw_bytearray, 4, 4);
        float yaw_Rud_Int = Base_Conversion.byte2float(yaw_bytearray, 4);
        // byte[] yaw_Rud_up_bytes = Base_Conversion.subBytes(yaw_bytearray, 8, 4);
        float yaw_Rud_up = Base_Conversion.byte2float(yaw_bytearray, 8);
        // byte[] yaw_Rud_down_bytes = Base_Conversion.subBytes(yaw_bytearray, 12, 4);
        float yaw_Rud_down = Base_Conversion.byte2float(yaw_bytearray, 12);
        //  byte[] yaw_Xp_bytes = Base_Conversion.subBytes(yaw_bytearray, 16, 4);
        float yaw_Xp = Base_Conversion.byte2float(yaw_bytearray, 16);
        // byte[] yaw_Gyr_p_bytes = Base_Conversion.subBytes(yaw_bytearray, 20, 4);
        float yaw_Gyr_p = Base_Conversion.byte2float(yaw_bytearray, 20);
        //byte[] yaw_Gyr_i_bytes = Base_Conversion.subBytes(yaw_bytearray, 24, 4);
        float yaw_Gyr_i = Base_Conversion.byte2float(yaw_bytearray, 24);
        //  byte[] yaw_Yaw_lh_bytes = Base_Conversion.subBytes(yaw_bytearray, 28, 4);
        float yaw_Yaw_lh = Base_Conversion.byte2float(yaw_bytearray, 28);
        //  byte[] yaw_Yaw_p_bytes = Base_Conversion.subBytes(yaw_bytearray, 32, 4);
        float yaw_Yaw_p = Base_Conversion.byte2float(yaw_bytearray, 32);
        //   byte[] yaw_Yaw_i_bytes = Base_Conversion.subBytes(yaw_bytearray, 36, 4);
        float yaw_Yaw_i = Base_Conversion.byte2float(yaw_bytearray, 36);
        // byte[] yaw_Yaw_i_l_bytes = Base_Conversion.subBytes(yaw_bytearray, 40, 4);
        float yaw_Yaw_i_l = Base_Conversion.byte2float(yaw_bytearray, 40);
        //  byte[] yaw_Auto_yaw_l_bytes = Base_Conversion.subBytes(yaw_bytearray, 44, 4);
        float yaw_Auto_yaw_l = Base_Conversion.byte2float(yaw_bytearray, 44);
        // float[] yaw_floatarray = Base_Conversion.byteArrayToFloatArray(yaw_bytearray);
        Configuration_parameter_Bean.Yaw_Bean yaw_bean = new Configuration_parameter_Bean.Yaw_Bean();
        yaw_bean.setSv_type(yaw_Sv_type);
        yaw_bean.setRud_int(yaw_Rud_Int);
        yaw_bean.setRud_up(yaw_Rud_up);
        yaw_bean.setRud_down(yaw_Rud_down);
        yaw_bean.setXp(yaw_Xp);
        yaw_bean.setGyr_p(yaw_Gyr_p);
        yaw_bean.setGyr_i(yaw_Gyr_i);
        yaw_bean.setYaw_lh(yaw_Yaw_lh);
        yaw_bean.setYaw_p(yaw_Yaw_p);
        yaw_bean.setYaw_i(yaw_Yaw_i);
        yaw_bean.setYaw_i_l(yaw_Yaw_i_l);
        yaw_bean.setAuto_yaw_l(yaw_Auto_yaw_l);
        configurationParameterBean.setYaw_bean(yaw_bean);


        byte[] lateral_velocity_bytearray = Base_Conversion.subBytes(bytes, 96, 56);//横向速度
        // float[] lateral_velocity_floatarray = Base_Conversion.byteArrayToFloatArray(lateral_velocity_bytearray);
        Configuration_parameter_Bean.Lateral_velocity_Bean lateralVelocityBean = new Configuration_parameter_Bean.Lateral_velocity_Bean();
        //  byte[] lateral_velocityRoll_P_bytes = Base_Conversion.subBytes(lateral_velocity_bytearray, 0, 4);
        float lateral_velocity_Roll_P = Base_Conversion.byte2float(lateral_velocity_bytearray, 0);
        //  byte[] lateral_velocity_Roll_i_bytes = Base_Conversion.subBytes(lateral_velocity_bytearray, 4, 4);
        float lateral_velocity_Roll_i = Base_Conversion.byte2float(lateral_velocity_bytearray, 4);
        // byte[] lateral_velocity_Roll_d_bytes = Base_Conversion.subBytes(lateral_velocity_bytearray, 8, 4);
        float lateral_velocity_Roll_d = Base_Conversion.byte2float(lateral_velocity_bytearray, 8);
        // byte[] lateral_velocity_Vgyr_limit_bytes = Base_Conversion.subBytes(lateral_velocity_bytearray, 12, 4);
        float lateral_velocity_Vgyr_limit = Base_Conversion.byte2float(lateral_velocity_bytearray, 12);
        // byte[] lateral_velocity_Roll_trim_bytes = Base_Conversion.subBytes(lateral_velocity_bytearray, 16, 4);
        float lateral_velocity_Roll_trim = Base_Conversion.byte2float(lateral_velocity_bytearray, 16);
        // byte[] lateral_velocity_Vy_delta_bytes = Base_Conversion.subBytes(lateral_velocity_bytearray, 20, 4);
        float lateral_velocity_Vy_delta = Base_Conversion.byte2float(lateral_velocity_bytearray, 20);
        // byte[] lateral_velocity_A_vy_limit_bytes = Base_Conversion.subBytes(lateral_velocity_bytearray, 24, 4);
        float lateral_velocity_A_vy_limit = Base_Conversion.byte2float(lateral_velocity_bytearray, 24);
        // byte[] lateral_velocity_Vy_p_bytes = Base_Conversion.subBytes(lateral_velocity_bytearray, 28, 4);
        float lateral_velocity_Vy_p = Base_Conversion.byte2float(lateral_velocity_bytearray, 28);
        // byte[] lateral_velocity_Vy_i_bytes = Base_Conversion.subBytes(lateral_velocity_bytearray, 32, 4);
        float lateral_velocity_Vy_i = Base_Conversion.byte2float(lateral_velocity_bytearray, 32);
        // byte[] lateral_velocity_Vy_d_bytes = Base_Conversion.subBytes(lateral_velocity_bytearray, 36, 4);
        float lateral_velocity_Vy_d = Base_Conversion.byte2float(lateral_velocity_bytearray, 36);
        // byte[] lateral_velocity_Roll_limit_bytes = Base_Conversion.subBytes(lateral_velocity_bytearray, 40, 4);
        float lateral_velocity_Roll_limit = Base_Conversion.byte2float(lateral_velocity_bytearray, 40);
        // byte[] lateral_velocity_Vy_lh_bytes = Base_Conversion.subBytes(lateral_velocity_bytearray, 44, 4);
        float lateral_velocity_Vy_lh = Base_Conversion.byte2float(lateral_velocity_bytearray, 44);
        //   byte[] lateral_velocity_Vy_limit_bytes = Base_Conversion.subBytes(lateral_velocity_bytearray, 48, 4);
        float lateral_velocity_Vy_limit = Base_Conversion.byte2float(lateral_velocity_bytearray, 48);
        //  byte[] lateral_velocity_Posy_p_bytes = Base_Conversion.subBytes(lateral_velocity_bytearray, 52, 4);
        float lateral_velocity_Posy_p = Base_Conversion.byte2float(lateral_velocity_bytearray, 52);
        lateralVelocityBean.setRoll_p(lateral_velocity_Roll_P);
        lateralVelocityBean.setRoll_i(lateral_velocity_Roll_i);
        lateralVelocityBean.setRoll_d(lateral_velocity_Roll_d);
        lateralVelocityBean.setVgyr_limit(lateral_velocity_Vgyr_limit);
        lateralVelocityBean.setRoll_trim(lateral_velocity_Roll_trim);
        lateralVelocityBean.setVy_delta(lateral_velocity_Vy_delta);
        lateralVelocityBean.setA_vy_limit(lateral_velocity_A_vy_limit);
        lateralVelocityBean.setVy_p(lateral_velocity_Vy_p);
        lateralVelocityBean.setVy_i(lateral_velocity_Vy_i);
        lateralVelocityBean.setVy_d(lateral_velocity_Vy_d);
        lateralVelocityBean.setRoll_limit(lateral_velocity_Roll_limit);
        lateralVelocityBean.setVy_lh(lateral_velocity_Vy_lh);
        lateralVelocityBean.setVy_limit(lateral_velocity_Vy_limit);
        lateralVelocityBean.setPosy_p(lateral_velocity_Posy_p);
        configurationParameterBean.setLateral_velocity_bean(lateralVelocityBean);


        byte[] longitudinal_velocity_bytearray = Base_Conversion.subBytes(bytes, 152, 56);//纵向速度
        //  float[] longitudinal_velocity_floatarray = Base_Conversion.byteArrayToFloatArray(longitudinal_velocity_bytearray);

        Configuration_parameter_Bean.Longitudinal_velocity_Bean longitudinalVelocityBean = new Configuration_parameter_Bean.Longitudinal_velocity_Bean();
        // byte[] longitudinal_velocity_Pitch_p_bytes = Base_Conversion.subBytes(longitudinal_velocity_bytearray, 0, 4);
        float longitudinal_velocity_Pitch_p = Base_Conversion.byte2float(longitudinal_velocity_bytearray, 0);
        // byte[] longitudinal_velocity_Pitch_I_bytes = Base_Conversion.subBytes(longitudinal_velocity_bytearray, 4, 4);
        float longitudinal_velocity_Pitch_i = Base_Conversion.byte2float(longitudinal_velocity_bytearray, 4);
        // byte[] longitudinal_velocity_Pitch_d_bytes = Base_Conversion.subBytes(longitudinal_velocity_bytearray, 8, 4);
        float longitudinal_velocity_Pitch_d = Base_Conversion.byte2float(longitudinal_velocity_bytearray, 8);
        //byte[] longitudinal_velocity_Vgyr_limit_bytes = Base_Conversion.subBytes(longitudinal_velocity_bytearray, 12, 4);
        float longitudinal_velocity_Vgyr_limit = Base_Conversion.byte2float(longitudinal_velocity_bytearray, 12);
        // byte[] longitudinal_velocity_Pitch_trim_bytes = Base_Conversion.subBytes(longitudinal_velocity_bytearray, 16, 4);
        float longitudinal_velocity_Pitch_trim = Base_Conversion.byte2float(longitudinal_velocity_bytearray, 16);
        //  byte[] longitudinal_velocity_Vx_delta_bytes = Base_Conversion.subBytes(longitudinal_velocity_bytearray, 20, 4);
        float longitudinal_velocity_Vx_delta = Base_Conversion.byte2float(longitudinal_velocity_bytearray, 20);
        //    byte[] longitudinal_velocity_A_vx_limit_bytes = Base_Conversion.subBytes(longitudinal_velocity_bytearray, 24, 4);
        float longitudinal_velocity_A_vx_limit = Base_Conversion.byte2float(longitudinal_velocity_bytearray, 24);
        // byte[] longitudinal_velocity_Vx_p_bytes = Base_Conversion.subBytes(longitudinal_velocity_bytearray, 28, 4);
        float longitudinal_velocity_Vx_p = Base_Conversion.byte2float(longitudinal_velocity_bytearray, 28);
        //  byte[] longitudinal_velocity_Vx_i_bytes = Base_Conversion.subBytes(longitudinal_velocity_bytearray, 32, 4);
        float longitudinal_velocity_Vx_i = Base_Conversion.byte2float(longitudinal_velocity_bytearray, 32);
        // byte[] longitudinal_velocity_Vx_d_bytes = Base_Conversion.subBytes(longitudinal_velocity_bytearray, 36, 4);
        float longitudinal_velocity_Vx_d = Base_Conversion.byte2float(longitudinal_velocity_bytearray, 36);
        //byte[] longitudinal_velocity_Pitch_limit_bytes = Base_Conversion.subBytes(longitudinal_velocity_bytearray, 40, 4);
        float longitudinal_velocity_Pitch_limit = Base_Conversion.byte2float(longitudinal_velocity_bytearray, 40);
        //byte[] longitudinal_velocity_Vx_lh_bytes = Base_Conversion.subBytes(longitudinal_velocity_bytearray, 44, 4);
        float longitudinal_velocity_Vx_lh = Base_Conversion.byte2float(longitudinal_velocity_bytearray, 44);
        //  byte[] longitudinal_velocity_Vx_limit_bytes = Base_Conversion.subBytes(longitudinal_velocity_bytearray, 48, 4);
        float longitudinal_velocity_Vx_limit = Base_Conversion.byte2float(longitudinal_velocity_bytearray, 48);
        //   byte[] longitudinal_velocity_Posx_p_bytes = Base_Conversion.subBytes(longitudinal_velocity_bytearray, 52, 4);
        float longitudinal_velocity_Posx_p = Base_Conversion.byte2float(longitudinal_velocity_bytearray, 52);
        longitudinalVelocityBean.setPitch_p(longitudinal_velocity_Pitch_p);
        longitudinalVelocityBean.setPitch_I(longitudinal_velocity_Pitch_i);
        longitudinalVelocityBean.setPitch_d(longitudinal_velocity_Pitch_d);
        longitudinalVelocityBean.setVgyr_limit(longitudinal_velocity_Vgyr_limit);
        longitudinalVelocityBean.setPitch_trim(longitudinal_velocity_Pitch_trim);
        longitudinalVelocityBean.setVx_delta(longitudinal_velocity_Vx_delta);
        longitudinalVelocityBean.setA_vx_limit(longitudinal_velocity_A_vx_limit);
        longitudinalVelocityBean.setVx_p(longitudinal_velocity_Vx_p);
        longitudinalVelocityBean.setVx_i(longitudinal_velocity_Vx_i);
        longitudinalVelocityBean.setVx_d(longitudinal_velocity_Vx_d);
        longitudinalVelocityBean.setPitch_limit(longitudinal_velocity_Pitch_limit);
        longitudinalVelocityBean.setVx_lh(longitudinal_velocity_Vx_lh);
        longitudinalVelocityBean.setVx_limit(longitudinal_velocity_Vx_limit);
        longitudinalVelocityBean.setPosx_p(longitudinal_velocity_Posx_p);
        configurationParameterBean.setLongitudinal_velocity_bean(longitudinalVelocityBean);


        byte[] height_bytearray = Base_Conversion.subBytes(bytes, 208, 60);//高度
        //float[] height_floatarray = Base_Conversion.byteArrayToFloatArray(height_bytearray);
        Configuration_parameter_Bean.Height_Bean height_bean = new Configuration_parameter_Bean.Height_Bean();
        // byte[] height_Vz_lh_bytes = Base_Conversion.subBytes(height_bytearray, 0, 4);
        float height_Vz_lh = Base_Conversion.byte2float(height_bytearray, 0);
        //  byte[] height_Posz_p_bytes = Base_Conversion.subBytes(height_bytearray, 4, 4);
        float height_Posz_p = Base_Conversion.byte2float(height_bytearray, 4);
        // byte[] height_Vz_limit_bytes = Base_Conversion.subBytes(height_bytearray, 8, 4);
        float height_Vz_limit = Base_Conversion.byte2float(height_bytearray, 8);
        //  byte[] height_Vz_delta_bytes = Base_Conversion.subBytes(height_bytearray, 12, 4);
        float height_Vz_delta = Base_Conversion.byte2float(height_bytearray, 12);
        // byte[] height_Vz_trim_bytes = Base_Conversion.subBytes(height_bytearray, 16, 4);
        float height_Vz_trim = Base_Conversion.byte2float(height_bytearray, 16);
        //   byte[] height_Vz_abs_bytes = Base_Conversion.subBytes(height_bytearray, 20, 4);
        float height_Vz_abs = Base_Conversion.byte2float(height_bytearray, 20);
        // byte[] height_Vz_p_bytes = Base_Conversion.subBytes(height_bytearray, 24, 4);
        float height_Vz_p = Base_Conversion.byte2float(height_bytearray, 24);
        //  byte[] height_Vz_i_bytes = Base_Conversion.subBytes(height_bytearray, 28, 4);
        float height_Vz_i = Base_Conversion.byte2float(height_bytearray, 28);
        // byte[] height_Vz_i_abs_bytes = Base_Conversion.subBytes(height_bytearray, 32, 4);
        float height_Vz_i_abs = Base_Conversion.byte2float(height_bytearray, 32);
        //  byte[] height_Col_abs_bytes = Base_Conversion.subBytes(height_bytearray, 36, 4);
        float height_Col_abs = Base_Conversion.byte2float(height_bytearray, 36);
        //  byte[] height_Col_kc_bytes = Base_Conversion.subBytes(height_bytearray, 40, 4);
        float height_Col_kc = Base_Conversion.byte2float(height_bytearray, 40);
        // byte[] height_One_bytes = Base_Conversion.subBytes(height_bytearray, 44, 4);
        float height_One = Base_Conversion.byte2float(height_bytearray, 44);
        // byte[] height_Two_bytes = Base_Conversion.subBytes(height_bytearray, 48, 4);
        float height_Two = Base_Conversion.byte2float(height_bytearray, 48);
        // byte[] height_Three_bytes = Base_Conversion.subBytes(height_bytearray, 52, 4);
        float height_Three = Base_Conversion.byte2float(height_bytearray, 52);
        //byte[] height_Imiata_bytes = Base_Conversion.subBytes(height_bytearray, 56, 4);
        float height_Imiata = Base_Conversion.byte2float(height_bytearray, 56);
        height_bean.setVz_lh(height_Vz_lh);
        height_bean.setPosz_p(height_Posz_p);
        height_bean.setVz_limit(height_Vz_limit);
        height_bean.setVz_delta(height_Vz_delta);
        height_bean.setVz_trim(height_Vz_trim);
        height_bean.setVz_abs(height_Vz_abs);
        height_bean.setVz_p(height_Vz_p);
        height_bean.setVz_i(height_Vz_i);
        height_bean.setVz_i_abs(height_Vz_i_abs);
        height_bean.setCol_abs(height_Col_abs);
        height_bean.setCol_kc(height_Col_kc);
        height_bean.setOne(height_One);
        height_bean.setTwo(height_Two);
        height_bean.setThree(height_Three);
        height_bean.setImiata(height_Imiata);
        configurationParameterBean.setHeight_bean(height_bean);


        byte[] constant_speed_bytearray = Base_Conversion.subBytes(bytes, 268, 44);//定速
        //  float[] constant_speed_floatarray = Base_Conversion.byteArrayToFloatArray(constant_speed_bytearray);
        Configuration_parameter_Bean.Constant_speed_Bean constantSpeedBean = new Configuration_parameter_Bean.Constant_speed_Bean();
        //  byte[] constant_speed_Sv_rev_bytes = Base_Conversion.subBytes(constant_speed_bytearray, 0, 4);
        float constant_speed_Sv_rev = Base_Conversion.byte2float(constant_speed_bytearray, 0);
        //  byte[] constant_speed_Speed_bytes = Base_Conversion.subBytes(constant_speed_bytearray, 4, 4);
        float constant_speed_Speed = Base_Conversion.byte2float(constant_speed_bytearray, 4);
        //   byte[] constant_speed_p_bytes = Base_Conversion.subBytes(constant_speed_bytearray, 8, 4);
        float constant_speed_p = Base_Conversion.byte2float(constant_speed_bytearray, 8);
        // byte[] constant_speed_i_bytes = Base_Conversion.subBytes(constant_speed_bytearray, 12, 4);
        float constant_speed_i = Base_Conversion.byte2float(constant_speed_bytearray, 12);
        // byte[] constant_speed_d_bytes = Base_Conversion.subBytes(constant_speed_bytearray, 16, 4);
        float constant_speed_d = Base_Conversion.byte2float(constant_speed_bytearray, 16);
        // byte[] constant_speed_Sppoint_bytes = Base_Conversion.subBytes(constant_speed_bytearray, 20, 4);
        float constant_speed_Sppoint = Base_Conversion.byte2float(constant_speed_bytearray, 20);
        // byte[] constant_speed_Step_bytes = Base_Conversion.subBytes(constant_speed_bytearray, 24, 4);
        float constant_speed_Step = Base_Conversion.byte2float(constant_speed_bytearray, 24);
        //   byte[] constant_speed_on_bytes = Base_Conversion.subBytes(constant_speed_bytearray, 28, 4);
        float constant_speed_on = Base_Conversion.byte2float(constant_speed_bytearray, 28);
        // byte[] constant_speed_range_bytes = Base_Conversion.subBytes(constant_speed_bytearray, 32, 4);
        float constant_speed_range = Base_Conversion.byte2float(constant_speed_bytearray, 32);
        //byte[] constant_speed_max_bytes = Base_Conversion.subBytes(constant_speed_bytearray, 36, 4);
        float constant_speed_max = Base_Conversion.byte2float(constant_speed_bytearray, 36);
        // byte[] constant_speed_min_bytes = Base_Conversion.subBytes(constant_speed_bytearray, 40, 4);
        float constant_speed_min = Base_Conversion.byte2float(constant_speed_bytearray, 40);

        constantSpeedBean.setSv_rev(constant_speed_Sv_rev);
        constantSpeedBean.setSpeed(constant_speed_Speed);
        constantSpeedBean.setP(constant_speed_p);
        constantSpeedBean.setI(constant_speed_i);
        constantSpeedBean.setD(constant_speed_d);
        constantSpeedBean.setSppoint(constant_speed_Sppoint);
        constantSpeedBean.setStep(constant_speed_Step);
        constantSpeedBean.setOn(constant_speed_on);
        constantSpeedBean.setRange(constant_speed_range);
        constantSpeedBean.setMax(constant_speed_max);
        constantSpeedBean.setMin(constant_speed_min);

        configurationParameterBean.setConstant_speed_bean(constantSpeedBean);


        byte[] tilt_plate_bytearray = Base_Conversion.subBytes(bytes, 312, 44);//倾斜盘
        // float[] tilt_plate_floatarray = Base_Conversion.byteArrayToFloatArray(tilt_plate_bytearray);
        Configuration_parameter_Bean.Tilt_plate_Bean tiltPlateBean = new Configuration_parameter_Bean.Tilt_plate_Bean();
        // byte[] tilt_plate_Installation_direction_bytes = Base_Conversion.subBytes(tilt_plate_bytearray, 0, 4);
        float tilt_plate_Installation_direction = Base_Conversion.byte2float(tilt_plate_bytearray, 0);  //
        // byte[] tilt_plate_Travel_coefficient_bytes = Base_Conversion.subBytes(tilt_plate_bytearray, 4, 4);
        float tilt_plate_Travel_coefficient = Base_Conversion.byte2float(tilt_plate_bytearray, 4);
        // byte[] tilt_plate_midpoint_1_bytes = Base_Conversion.subBytes(tilt_plate_bytearray, 8, 4);
        float tilt_plate_midpoint_1 = Base_Conversion.byte2float(tilt_plate_bytearray, 8);
        //  byte[] tilt_plate_midpoint_2_bytes = Base_Conversion.subBytes(tilt_plate_bytearray, 12, 4);
        float tilt_plate_midpoint_2 = Base_Conversion.byte2float(tilt_plate_bytearray, 12);
        //byte[] tilt_plate_midpoint_3_bytes = Base_Conversion.subBytes(tilt_plate_bytearray, 16, 4);
        float tilt_plate_midpoint_3 = Base_Conversion.byte2float(tilt_plate_bytearray, 16);
        //  byte[] tilt_plate_midpoint_4_bytes = Base_Conversion.subBytes(tilt_plate_bytearray, 20, 4);
        float tilt_plate_midpoint_4 = Base_Conversion.byte2float(tilt_plate_bytearray, 20);
        // byte[] tilt_plate_midpoint_5_bytes = Base_Conversion.subBytes(tilt_plate_bytearray, 24, 4);
        float tilt_plate_midpoint_5 = Base_Conversion.byte2float(tilt_plate_bytearray, 24);
        // byte[] tilt_plate_midpoint_6_bytes = Base_Conversion.subBytes(tilt_plate_bytearray, 28, 4);
        float tilt_plate_midpoint_6 = Base_Conversion.byte2float(tilt_plate_bytearray, 28);
        //   byte[] tilt_plate_Reverse_parameter_bytes = Base_Conversion.subBytes(tilt_plate_bytearray, 32, 4);
        float tilt_plate_Reverse_parameter = Base_Conversion.byte2float(tilt_plate_bytearray, 32);
        // byte[] tilt_plate_Model_bytes = Base_Conversion.subBytes(tilt_plate_bytearray, 36, 4);
        float tilt_plate_Model = Base_Conversion.byte2float(tilt_plate_bytearray, 36);
        // byte[] tilt_plate_Ins_type_bytes = Base_Conversion.subBytes(tilt_plate_bytearray, 40, 4);
        float tilt_plate_Ins_type = Base_Conversion.byte2float(tilt_plate_bytearray, 40);
        tiltPlateBean.setInstallation_direction(tilt_plate_Installation_direction);
        tiltPlateBean.setTravel_coefficient(tilt_plate_Travel_coefficient);
        tiltPlateBean.setSteering_gear_midpoint_1(tilt_plate_midpoint_1);
        tiltPlateBean.setSteering_gear_midpoint_2(tilt_plate_midpoint_2);
        tiltPlateBean.setSteering_gear_midpoint_3(tilt_plate_midpoint_3);
        tiltPlateBean.setSteering_gear_midpoint_4(tilt_plate_midpoint_4);
        tiltPlateBean.setSteering_gear_midpoint_5(tilt_plate_midpoint_5);
        tiltPlateBean.setSteering_gear_midpoint_6(tilt_plate_midpoint_6);
        tiltPlateBean.setReverse_parameter(tilt_plate_Reverse_parameter);
        tiltPlateBean.setModel(tilt_plate_Model);
        tiltPlateBean.setIns_type(tilt_plate_Ins_type);
        configurationParameterBean.setTilt_plate_bean(tiltPlateBean);

        byte[] power_limitation_bytearray = Base_Conversion.subBytes(bytes, 356, 16);//功率限制
        // float[] power_limitation_floatarray = Base_Conversion.byteArrayToFloatArray(power_limitation_bytearray);
        Configuration_parameter_Bean.Power_limitation_bean power_limitation_bean = new Configuration_parameter_Bean.Power_limitation_bean();
        //byte[] power_limitation_Installation_direction_bytes = Base_Conversion.subBytes(power_limitation_bytearray, 0, 4);
        float power_limitation_Installation_direction = Base_Conversion.byte2float(power_limitation_bytearray, 0);
        //    byte[] power_limitation_Total_distance_limitratio_bytes = Base_Conversion.subBytes(power_limitation_bytearray, 4, 4);
        float power_limitation_Total_distance_limitratio = Base_Conversion.byte2float(power_limitation_bytearray, 4);
        //   byte[] power_limitation_Throttle_limit_ratio_bytes = Base_Conversion.subBytes(power_limitation_bytearray, 8, 4);
        float power_limitation_Throttle_limit_ratio = Base_Conversion.byte2float(power_limitation_bytearray, 8);
        // byte[] power_limitation_Power_decay_rate_bytes = Base_Conversion.subBytes(power_limitation_bytearray, 12, 4);
        float power_limitation_Power_decay_rate = Base_Conversion.byte2float(power_limitation_bytearray, 12);
        power_limitation_bean.setPower_limitation_Enable(power_limitation_Installation_direction);
        power_limitation_bean.setTotal_distance_limitratio(power_limitation_Total_distance_limitratio);
        power_limitation_bean.setThrottle_limit_ratio(power_limitation_Throttle_limit_ratio);
        power_limitation_bean.setPower_decay_rate(power_limitation_Power_decay_rate);
        configurationParameterBean.setPower_limitation(power_limitation_bean);
        return configurationParameterBean;
    }*/
   /* *//**
     * 解析采点器数据
     *//*
    public Point_Sampler_Bean point_Sampler_Data(byte[] point_radio_data) {
        //  byte[] point_radio_data = BuildConfig.mining_point_Radio_Data;


        byte[] Sol_stat_byte = Base_Conversion.subBytes(point_radio_data, 18, 4);
        int Sol_stat_Int = Base_Conversion.byte2int(Sol_stat_byte);
        pointSamplerBean.setSol_stat(Sol_stat_Int);


        byte[] Postype_byte = Base_Conversion.subBytes(point_radio_data, 22, 4);
        int Postype_Int = Base_Conversion.byte2int(Postype_byte);
        pointSamplerBean.setPostype(Postype_Int);


        byte[] lat_byte = Base_Conversion.subBytes(point_radio_data, 26, 8);
        double lat_double = Base_Conversion.bytes2Double(lat_byte);
        pointSamplerBean.setLat(lat_double);


        byte[] lon_byte = Base_Conversion.subBytes(point_radio_data, 34, 8);
        double lon_double = Base_Conversion.bytes2Double(lon_byte);
        pointSamplerBean.setLon(lon_double);


        byte[] height_byte = Base_Conversion.subBytes(point_radio_data, 42, 8);
        double height_double = Base_Conversion.bytes2Double(height_byte);
        pointSamplerBean.setHeight(height_double);


        byte[] solnsvs_byte = Base_Conversion.subBytes(point_radio_data, 83, 1);
        pointSamplerBean.setSolnsvs(solnsvs_byte[0]);


        return pointSamplerBean;
    }*/
}
